﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/MasterPages/Site.Master" Inherits="RushTracker.Web.UI.RushTrackerViewPage<RushTracker.Core.Models.Torrents.Torrent>" %>

<asp:Content runat="server" ContentPlaceHolderID="head">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#expandlink").click(function () {
                $.ajax({
                    type: "GET",
                    url: $(this).attr("href"),

                    success: function (data, status) {
                        $("#filescontainer").html(data);
                    }
                });

                return false;
            });
        });
    </script>
</asp:Content>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="mainContent">
    <div class="box">
        <a href="/torrent/download/<%= Model.Id %>" class="downloadlink icon-download">Download</a>
        <h2><%: Model.Name %></h2>
        
        <div class="boxcontent">
            <table style="width: 100%;">
                <tr>
                    <td style="width: 140px;" class="hint">Description</td>
                    <td><%: Model.Description %></td>
                </tr>
                <tr>
                    <td class="hint">Files</td>
                    <td id="filescontainer">
                        <%: Model.Information.Files.Count.ToString() %> (<%= Html.ActionLink("expand", "Show", "Torrents", new { torrentId = Model.Id, d = "expandFiles" }, new { @id = "expandlink" })%>)
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>